<template>
	<view class="bg-white" style="background: #90AEE0;min-height: 100vh;"
		:style="{background:'url('+Imgbase+'/'+skin+'_goodpoor_bgc.png)','background-size':'100%',}">

		<view class="padding-top-50 padding-left-40 flex-between">
			<view class="flex-between">
				<image class="w-80 h-80" :src="Imgbase+'/'+skin+'_goodpoor_img1.png'" mode="aspectFit" @click="back">
				</image>

				<view class="padding-left-20 padding-top-25">
					<image :class="skin == 'classics'?'w-100 h-100':'w-110 h-130'" @click="gobape"
						:src="Imgbase+'/'+skin+'_goodpoor_img2.png'" mode="aspectFit">
					</image>
				</view>
			</view>


			<view class=" padding-right-35 padding-top-95 df alc padding-top-15">
				<button class="w-140 h-105"
					style="display: flex;justify-content: right;overflow: hidden;background-color:transparent;"
					open-type="share">
					<image class="w100 h100" mode="aspectFit" :src="Imgbase + '/new_goodinfdex_img4.png'">
					</image>
				</button>
				<image class="w-100 h-80" :src="Imgbase + '/new_goodinfdex_img2.png'" mode="aspectFit"
					@click="showExplain(22)">
				</image>
			</view>
		</view>

		<!--  -->
		<view class="w-680 radius-20 top_item h-600"
			:style="{background:'url('+Imgbase+'/new_goodfanx_img14.png)','background-size':'100% 100%',}">
			<view class="w100 text-center" style="position: relative;">
				<image class="w-570 h-440 radius-20 imgto" :src="desc.adimage" mode="aspectFill" @click="viewAdimage()">
				</image>
				<view class="" style="position: absolute;left: 32rpx;top: 250rpx;">
					<scroll-view scroll-y class="" scroll-with-animation style="height: 200rpx;overflow: hidden;">
						<view class=" h100 fff font-17">
							<view class=" w100 padding-10" v-for="(item,index) in desc.reword_text" :key="index">
								<view class='text_item'
									v-if="item.reword_type_name == 'First'||item.reword_type_name == 'Last'||item.reword_type_name == '全局'||item.reword_type_name == '冲冲'">
									{{item.reword_type_name}}:{{item.nownumber}}/{{item.allnumber}}
								</view>
								<view class='text_item'
									v-if="item.reword_type_name != 'First'&&item.reword_type_name != 'Last'&&item.reword_type_name != '全局'&&item.reword_type_name != '冲冲'&&item.nownumber!=0">
									{{item.reword_type_name}}:{{Number(item.nownumber/desc.count*100).toFixed(1)}}%
								</view>
								<view class='text_item'
									v-if="item.reword_type_name != 'First'&&item.reword_type_name != 'Last'&&item.reword_type_name != '全局'&&item.reword_type_name != '冲冲'&&item.nownumber==0">
									{{item.reword_type_name}}:0.00%
								</view>
							</view>
						</view>
					</scroll-view>
				</view>
			</view>

			<view class="flex-between padding-left-45 padding-right-45 padding-top-15 Afont">
				<view class="font-37 Afont one-line" style="color:#F9FADA     ;width: 75%;">
					{{desc.title}}
				</view>

				<view class="Bfont font-42" style="color: #E60000;">
					￥{{desc.cost}}
				</view>
			</view>

			<!-- 繁星 -->
			<view class="fan_item h-115 w-300" v-if="desc.more_star_template_id > 0 && desc.more_star_num > 0">
				<image class="h100 w100" :src="Imgbase + '/new_goodfanx_img3.png'" mode="aspectFit" @click="gofan">
				</image>
			</view>
		</view>

		<view class="bottom_item">

			<!-- 经典皮肤 -->
			<view class="bgcimg h-400" v-if="skin == 'classics'">
				<image class="w100 h100" :src="Imgbase + '/new_goodinfdex_img8.png'" mode="widthFix">
				</image>
			</view>

			<view class="" v-if="skin == 'winter'">
				<view class="bgcimgwinter">
					<image class="w100 h-400" :src="Imgbase + '/winter_goodpoor_img4.png'" mode="aspectFit">
					</image>
				</view>

				<view class="bgcimg1">
					<image class="w100 h-200" :src="Imgbase + '/winter_goodpoor_img9.png'" mode="aspectFit">
					</image>
				</view>
			</view>

			<view class="">
				<image class="h-130 xingbgc" :src="Imgbase + '/new_goodfanx_img7.png'" mode="aspectFit">
				</image>
			</view>

			<view class="bgc_bot" :class="skin == 'classics'?'skinbgc':''">

				<view class="w100 h100"
					:style="{background:'url('+Imgbase+'/'+skin+'_goodpoor_img5.png)','background-size':'100%',}">
					<!-- tab切换 -->
					<view class="w100 flex-between padding-top-30 padding-left-160 padding-right-160"
						style="position: relative;z-index: 99;">
						<view class="">
							<image @click="tab_btn(1)" class="w-165 h-70"
								:src=" Imgbase+'/'+skin+'_goodpoor_img13' + [tab==1?'_c':''] + '.png'" mode="aspectFit">
							</image>
						</view>
						<view class="">
							<image @click="tab_btn(2)" class="w-165 h-70"
								:src=" Imgbase+'/'+skin+'_goodpoor_img14' + [tab==2?'_c':''] + '.png'" mode="aspectFit">
							</image>
						</view>
					</view>

					<view class="padding-left-120 padding-right-120 padding-top-8">
						<!-- {{explain1}} -->

						<image class="w100 h-80" :src="Imgbase+'/'+skin+'_goodpoor_img7.png'" mode="aspectFit">
						</image>
					</view>

					<!-- 奖池-->
					<view class="padding-20" style="overflow: hidden;position: relative;z-index: 99;" v-if="tab == 1">
						<view class="cu-item fl text-sm padding-8 radius-10 list_item  fff" style="width: 22%;margin-bottom: 10upx;
						margin-top: 0rpx;position: relative;" v-for="(item,index) in desc.info_text" :key="index"
							:style="{background:'url('+Imgbase+'/'+skin+'_goodpoord_img3n.png)','background-size':'100% 100%',}">
							<view class="image" @click="lookImages(item.adimage,item.name,item.back_price)">
								<view class="bg-black"
									style="position: absolute;width: 97%;height: 150rpx;z-index: 20;display: flex;justify-content: center;align-items: center;"
									v-if="item.nownumber == 0">
									<image :src="Imgbase + '/1zhan_selled.png'" mode="aspectFit" class="w100 h100">
									</image>

								</view>
								<image class="radius-8" :src="item.adimage" mode="aspectFit" style="height: 140rpx;">
								</image>
								<view class="cu-bar " style="
								display: block;line-height: 40upx;opacity: 0.9;height: 150upx;">
									<image :src="Imgbase + '/new_goodfanx_img6.png'" class="w-80 h-35" mode="aspectFit"
										v-if="item.reword_type_id == 47"></image>
									<image :src="Imgbase + '/new_goodfanx_img13.png'" class="w-100 h-30"
										mode="aspectFit" v-if="item.reword_type_id == 48"></image>
									<view class="w100 one-line fff Afont font-18"
										:class="skin == 'qing'?'qingcolor':'orcolor'">
										{{item.name}}
									</view>
									<view style="clear: both;"></view>
									<view class="lh-20" :class="skin == 'qing'?'qingcolor':'orcolor'">
										<view class="font-18 Afont">
											<!-- <text class="" style="color: #59100B;">
														<text v-if="desc.type == '1'">回收价:￥</text><text
															v-if="desc.type == '2'">兑换积分:</text><text class="font-24"
															v-if="desc.cost > 999">{{desc.cost}}
														</text>
														<text class="font-16" v-else>回收价:￥{{desc.cost}}
														</text></text> -->
											<view class="" v-if="parseInt(item.back_price)>parseInt(desc.cost)">
												<text class="font-16">盲盒价:</text>{{item.back_price}}
											</view>
											<view class="" v-else>
												<text class="font-16">盲盒价:</text>{{desc.cost}}
											</view>
										</view>
									</view>
									<view class="flex-between w100">
										<view class="w100 font-16 Afont">
											<view class="" v-if="item.reword_type_id == 33">
												购买最多赠送
											</view>
											<view class="font-20" v-if="item.reword_type_id == 3">
												单次赠送概率:{{(1/desc.number*100).toFixed(2)}}%
											</view>
											<view class=""
												v-if="item.reword_type_id !== 3 && item.reword_type_id !== 33">
												<text
													class="font-16">获得概率</text>:{{item.point/item.base*100==100?item.point/item.base*100:(item.point/item.base*100).toFixed(2)}}%
											</view>
										</view>
									</view>

								</view>
							</view>
						</view>
					</view>

					<!-- 记录 -->
					<view class=" record Afont padding-20 radius-10" v-if="tab == 2"
						:class="skin == 'winter'?'skinwin':'skinca'">
						<!-- 繁星-->
						<view class="solid-bottom light" v-for="(item,index) in xinglist2" :key="index"
							style="width: 94%;margin-left: 3%;">
							<view class="action fl text-sm  text-ablack  text_color2"
								style="text-align: center;width: 110rpx;padding-left: 0;padding-right: 5rpx;">
								<view class="action text-lg text-center text-bold" style="padding-top: 30rpx;"
									v-if="item.reword_type_id != 33&&item.reword_type_id != 34&&item.reword_type_id !== 43&&item.reword_type_id !== 42">
									{{item.index}}
								</view>
								<text>{{item.paytime_text}}</text>
							</view>
							<view class="text-sm padding-sm text-grey fl" style="padding-top: 30rpx;">
								<view class="content text-ablack text-df"
									style="max-width: 260upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
									<text class="text_color2 text-bold"
										style="max-width: 260upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{item.usermes.nickname}}</text>
								</view>
								<view class="action text-df text_color2 text-bold"
									style="max-width: 300upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
									{{item.goodmes.name}}
								</view>
							</view>
							<view class="text-sm padding text-grey fr" style="padding-left: 0rpx;padding-right: 0rpx;">
								<view class="content fl text_color2 text-df">
									<image class="w-120 h-60 fl" v-if="item.reword_type_id == 48" mode="aspectFit"
										:src="Imgbase + '/new_goodfanx_img13.png'">
									</image>
								</view>
							</view>
							<view style="clear: both;"></view>
						</view>

						<view class="padding" style="width: 100%;height: 80upx;" v-if="xinglist2.length > 9">
							<view class="action fl">
								<image class="w-90 h-30" :src="Imgbase+'/'+skin+'_goodpoor_img11.png'"
									@click="jilupageleft(1)" mode="aspectFit"></image>
							</view>
							<view class="action fr">
								<image class="w-110 h-30" :src="Imgbase+'/'+skin+'_goodpoor_img12.png'"
									@click="jilupageright(1)" mode="aspectFit"></image>
							</view>
						</view>

						<!-- 摘星赏 -->
						<view class="" style="transition: .5s;overflow: hidden;" :class="zhan?'h-1250':'h-100'"
							:style="[{'--height':xinglist1.lenght}]">
							<view class="solid-bottom light text_color1" v-for="(item,index) in xinglist1" :key="index"
								style="width: 94%;margin-left: 3%;">
								<view class="action fl text-sm padding" style="padding-left: 0;padding-right: 5rpx;">
									<view class="action text-lg text_color1 text-center text-bold">
										{{item.index}}
									</view>
									{{item.paytime_text}}
								</view>
								<view class="text-sm padding-sm text-grey fl" style="padding-top: 30rpx;">
									<view class="content text-ablack text-df"
										style="max-width: 260upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
										<text class="text_color1 text-bold"
											style="max-width: 260upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{item.usermes.nickname}}</text>
									</view>
									<view class="action text-df text_color1 text-bold"
										style="max-width: 300upx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
										{{item.goodmes.name}}
									</view>
								</view>
								<view class="text-sm padding text-grey fr"
									style="padding-left: 0rpx;padding-right: 0rpx;">
									<view class="content fl text_color1 text-df">
										<image class="w-120 h-60 fl" v-if="item.reword_type_id == 47" mode="aspectFit"
											:src="Imgbase + '/new_goodfanx_img6.png'">
										</image>
									</view>
								</view>
								<view style="clear: both;"></view>
							</view>
						</view>
						<view class="text-center padding-top-20"
							style="text-decoration:underline;position: relative;z-index: 999;">
							<view class="" :class="skin == 'winter'?'text_color3':'text_color1'">
								<text v-if="zhan" @click="zhanplay()">收起</text>
								<text v-else @click="zhanplay()">展开</text>
							</view>
						</view>




						<view class="padding" style="width: 100%;height: 80upx;">
							<view class="action fl" v-if="zhan">
								<image class="w-90 h-30" :src="Imgbase+'/'+skin+'_goodpoor_img11.png'"
									@click="jilupageleft()" mode="aspectFit"></image>
							</view>
							<view class="action fr" v-if="zhan">
								<image class="w-110 h-30" :src="Imgbase+'/'+skin+'_goodpoor_img12.png'"
									@click="jilupageright()" mode="aspectFit"></image>
							</view>
						</view>
					</view>

					<view class="h-250">

					</view>
				</view>

			</view>
		</view>

		<!-- 购买按钮  春季皮肤 -->
		<view class="padding-20 flex-between btns w100 " v-if="skin == 'qing'">
			<!-- 购买 -->
			<view class="cu-capsule margin-bottom-sm round " v-if="desc.othertype ==3" @click="buybutton(2)">
				<image :src="Imgbase + '/qing_goodpoor_buy10.png'" v-show="desc.count >=10&&desc.othertype ==3"
					style="width: 220upx;height: 150upx;" mode="aspectFit"></image>
				<image :src="Imgbase + '/qing_goodpoor_buy10un.png'" v-show="desc.count <10&&desc.othertype ==3"
					style="width: 220upx;height: 150upx;" mode="aspectFit"></image>
			</view>
		
			<view class="" v-else style="width: 100%;">
		
				<!-- 单抽 -->
				<view class="">
					<view class=" " style="width: 250rpx;margin: 0 auto;" @click="buybutton(0)">
						<image :src="Imgbase + '/qing_goodpoor_buy1.png'" style="width: 220upx;height: 150upx;"
							mode="aspectFit"></image>
						<!-- <image :src="Imgbase + '//new_goodinfdex_buy1un.png'" v-show="desc.count <1"
									style="width: 220upx;height: 150upx;" mode="aspectFit"></image> -->
					</view>
				</view>
			</view>
		</view>


		<!-- 购买按钮 -->
		<view class="padding-20 flex-between btns w100 " v-else>
			<!-- 购买 -->
			<view class="cu-capsule margin-bottom-sm round " v-if="desc.othertype ==3" @click="buybutton(2)">
				<image :src="Imgbase + '/new_goodinfdex_buy10on.png'" v-show="desc.count >=10&&desc.othertype ==3"
					style="width: 220upx;height: 150upx;" mode="aspectFit"></image>
				<image :src="Imgbase + '//new_goodinfdex_buy10un.png'" v-show="desc.count <10&&desc.othertype ==3"
					style="width: 220upx;height: 150upx;" mode="aspectFit"></image>
			</view>

			<view class="" v-else style="width: 100%;">

				<!-- 单抽 -->
				<view class="">
					<view class=" " style="width: 250rpx;margin: 0 auto;" @click="buybutton(0)">
						<image :src="Imgbase + '//new_goodinfdex_buy1on.png'" style="width: 220upx;height: 150upx;"
							mode="aspectFit"></image>
						<!-- <image :src="Imgbase + '//new_goodinfdex_buy1un.png'" v-show="desc.count <1"
									style="width: 220upx;height: 150upx;" mode="aspectFit"></image> -->
					</view>
				</view>
			</view>
		</view>
		
		
		<view class="cu-modal" :class="modalName=='photomodel'?'show':''" @tap="hideModal">
			<view class="cu-dialog" style="width: 90%;height: 800rpx;background-color: #fff;" @tap.stop="">
				<view class="" style="width: 100%;position: relative;">
					<image :src="photoimg" mode="widthFix" style="width: 100%;height: 100%;"></image>
					<view class="" @click="modalName = null"
						style="position: absolute;width: 50rpx;height: 50rpx;top: 20rpx;right: 25rpx;z-index: 999;">
						<image :src="Imgbase + '/new1_infinite_close.png'" mode="widthFix"
							style="width: 100%;height: 100%;"></image>
					</view>
				</view>

				<view class="" style="margin-top: 40rpx;text-align: center;font-weight: bold;">
					{{looktitle}}
				</view>
				<!-- <view class="" style="margin-top: 10rpx;text-align: center;font-weight: bold;" v-if="lookprice > 0">
							市场价:￥{{lookprice}}
						</view> -->
			</view>
		</view>

		<!-- 恭喜获得 -->
		<u-popup :show="modalName2=='buyModal'" @close="hideModal2" mode="center" bgColor="transparent">
			<view class="" style="position: relative;">
				<view class="tiaoguo text-center" @click="tiaoplay" v-if="tiaotype == 0">
					跳过
				</view>
				<view class="w100 h-175">
					<image class="w-700 h100" :src="Imgbase + '/new_goodfanx_img9.png'" mode="aspectFit">
					</image>
				</view>
				<view class="w100 padding-left-30" style="position: relative;z-index: 99;min-height: 650rpx;">
					<view class="w-120 h-120 radius-8 jiangitem " v-for="(item,index) in mdata" :key="index"
						v-if="item.pos == 2">
						<view class="animation" :class="item.z_star ==true && item.type == 1?'opc ':'fanoff'"
							style="transition: .8s;display: block;">
						</view>
						<view class="losed lh-110 w100 h100 fff flex-center"
							:class="item.z_star ==false && item.type == 1?'opc':'fanoff'" style="transition: .8s;">
							x
						</view>
						<image class="w100 h100 radius-8" :src="item.adimage" style="transition: .6s;"
							:class="item.type == 0?'fanoff':'fanon'" mode="aspectFill"></image>
						<view class="baotext font-weight-500 Afont font-20"
							v-if="item.reword_type_id == 47&& item.type == 1">
							保底
						</view>
					</view>
					<scroll-view class="scroll text-left" scroll-y="true">
						<view class="w-120 h-120 radius-8 jiangitem " v-for="(item,idx) in mdata" :key="idx"
							v-if="item.pos == 1">
							<view class="animation" :class="item.z_star ==true && item.type == 1?'opc ':'fanoff'"
								style="transition: .8s;display: block;">

							</view>
							<view class="losed lh-120 w100 h100 fff flex-center"
								:class="item.z_star ==false && item.type == 1?'opc':'fanoff'" style="transition: .8s;">
								x
							</view>
							<image class="w100 h100 radius-8" :src="item.adimage" style="transition: .6s;"
								:class="item.type == 0?'fanoff':'fanon'" mode="aspectFill"></image>
						</view>
					</scroll-view>
				</view>

				<view class="w100 h-800 pos_bgc">
					<image class="w100 h100" :src="Imgbase + '/new_goodfanx_img11.png'" mode="aspectFit">
					</image>
				</view>
				<view class="w100 h-800 pos_bgc2">
					<image class="w100 h100" :src="Imgbase + '/new_goodfanx_img12.png'" mode="aspectFit">
					</image>
				</view>

				<view class="w100 text-center" style="position: relative;z-index: 99;">
					<image @click="hideModal2" class="w-300 h-80" :src="Imgbase + '/new_goodfanx_img8.png'"
						mode="aspectFit">
					</image>
				</view>
			</view>
		</u-popup>

		<view class="cu-modal" :class=" modalName=='getPhoneNumber'?'show':''">
			<view class="cu-dialog">
				<view class="cu-bar bg-white justify-end">
					<view class="content">认证手机号</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-red"></text>
					</view>
				</view>
				<view class="padding-xl bg-white">
					您还未认证手机号，为了程序功能的正常使用请您进行微信手机认证，否则将无法通过APP手机登录到该账号。
				</view>
				<view class="cu-bar bg-white justify-end">
					<view class="action">
						<button class="cu-btn line-blue text-blue" @tap="hideModal">取消</button>
						<button class="cu-btn bg-blue margin-left" open-type="getPhoneNumber"
							@getphonenumber="onGetPhoneNumber">确定</button>
					</view>
				</view>
			</view>
		</view>


		<view class="cu-modal bottom-modal" :class="modalName=='bottomModal'?'show':''">
			<view style="width: 100%;height: 1200upx;position: absolute;top: 0%;" @tap="hideModal"></view>
			<view class="cu-dialog padding-top-200 Afont" style="color: #8E4E0D;"
				:style="{background:'url('+Imgbase+'/new_goodinfdex_pay1.png)','background-size':'100% 100%',}">
				<view class="padding-left-30">
					<view class="fl w-175 h-175 ">
						<image class="w100 h100 radius-24" :src="desc.adimage" mode="aspectFit"></image>
					</view>
					<view class="fl text-left " style="padding-left: 30rpx;">
						<view class="text-lg padding-top-10 Bfont" style="color: #E60000;">
							￥<text class="font-45 padding-left-10">{{buymoney}}</text>
						</view>
						<view class="text-sm  padding-top-3" style="color: #8E4E0D;">
							单价({{desc.cost}}/次)
						</view>
						<view class="text-sm  padding-top-5">
							购买次数{{buycount}}次
						</view>
					</view>
				</view>
				<view style="clear: both;"></view>
				<view v-if="coupon > 0 && desc.type != '2'" class="padding-sm "
					:style="{background:'url('+Imgbase+'/new_goodinfdex_pay4.png)','background-size':'100% 100%',}"
					style="margin-left: 3%;width: 94%;border-radius: 20upx;margin-bottom: 20rpx;margin-top: 50rpx;">

					<view class="flex-between">
						<view class="">剩余{{Math.floor(coupon * 1000) / 100}}GOOD豆
							(可抵值{{ Math.floor(coupon * 100) / 100}})</view>
						<view class=" w-40 h-40 radius-20 margin-right-8 flex-center"
							style="border: 4rpx solid #8E4E0D;background-color: #fff;" @click="radioChange">
							<!-- <u-switch v-model="checked" active-color="#19BE6B" @change="radioChange"></u-switch> -->
							<view class="w-24 h-24 radius-12" style="background-color: #5F9764;" v-if="checked">

							</view>
						</view>
					</view>

					<!-- <view class="flex-between padding-top-10" v-if="score > 0 && desc.type != '2'">
								<view class="">剩余{{score}}积分
									(可抵值{{score/10>buymoney/2?buymoney/2:score/10}})</view>
								<view class=" w-40 h-40 radius-20 margin-right-8 flex-center"
									style="border: 4rpx solid #8E4E0D;background-color: #fff;" @click="scoreChange">
									<view class="w-24 h-24 radius-12" style="background-color: #5F9764;"
										v-if="scorechecked">
							
									</view>
								</view>
							</view> -->

				</view>
				<view style="clear: both;"></view>
				<view class="padding-sm" style="margin-left: 3%;width: 94%;border-radius: 20upx;"
					:style="{background:'url('+Imgbase+'/new_goodinfdex_pay3.png)','background-size':'100% 100%',}">
					<view class="flex-between">
						<view class="">需支付</view>
						<view class=" text-lg" style="color: #e66142;">￥{{buymoneys}}</view>
					</view>
					<view class="flex-between padding-top-15">
						<view class="">剩余余额</view>
						<view class=" text-lg" style="color: #e66142;">￥{{money}}</view>
					</view>
					<!-- <radio-group class="w100" @change="waysChanged">
								<label class="radio flex-between w100 padding-top-35">
									<view class="df alc">
										<view class="margin-right-20 w-60">
											<image class="w-50 h-50" :src="Imgbase + '/1app_login_zfblogo.png'"
												mode="aspectFit">
											</image>
										</view>
										<view class="padding-bottom-5">
											支付宝支付
										</view>
									</view>
									<radio color="#F78D51" value="2" :checked="ways == 2" />
								</label>
							</radio-group> -->

				</view>

				<view class="cu-bar padding-top-20">
					<view class="action flex-sub text-green " style="min-height: 100rpx;" @tap="submitLuck()">
						<image class="w-280 h-90" :src="Imgbase + '/new_goodinfdex_pay2.png'" mode="aspectFit">
						</image>
					</view>
				</view>
				<view style="clear: both;"></view>
				<view style="width: 100%;height: 40upx;"></view>
			</view>
		</view>

		<view class="cu-modal" :class="modalName=='Modal'?'show':''" @tap="hideModal">
			<view class="cu-dialog" style="background-color:initial;">
				<view class="bg-img"
					:style="{background:'url('+Imgbase+'/gooddetail_alarm_bg4.png) no-repeat','background-size':'100% 100%','height':'1200rpx'}">
					<view style="width: 100%;height: 90upx;"></view>
					<view class="">
						{{explain.title}}
					</view>
					<scroll-view class="scroll padding-xl text-left" scroll-y="true"
						style="padding:  30rpx 100rpx 100rpx;height: 70%;" v-html="explain.content">
					</scroll-view>
				</view>
			</view>
		</view>


		<view class="refresh">
			<image @click="startR" :style="{'transform': 'rotate('+360*refreshtime+'deg)','transition': 'all 1s'}"
				class="w-90 h-90" :src="Imgbase+'/'+skin+'_goodpoor_img6.png'" mode="aspectFit"></image>
		</view>

		<u-toast ref="uToast"></u-toast>


	</view>

</template>

<script>
	import md5 from '@/utils/md5.js'
	export default {
		data() {
			return {
				Imgbase: getApp().globalData.Imgbase,
				id: 0,
				desc: [],
				tab: 1,
				jilulogs: [],
				costMap: ['', '', '积分'],
				refreshtime: 0,
				openbuy: false,
				previous: 0,
				buyradio: 1,
				modalName: '',
				buymoney: 0,
				buymoneys: 0,
				buycount: 0,
				coupon: 0,
				coupon_s: 0,
				checked: true,
				did: 0,
				modalName2: '',
				liked: 0,
				money: 0,
				getspecial: false,
				addlength: 0,
				xinglist1: [],
				xinglist2: [],
				buylist: [],
				descm: [],
				timesd: 0,
				photoimg: '',
				looktitle: '',
				lookprice: 0,
				paged: 1,
				maxpaged: 0,
				maxpaged2: 0,
				explain: '',
				numa: 0,
				numqj: 0,
				explain1: '',
				hiddenlist: [],
				loadtime: false,
				poorlock: [],
				timesp: 0,
				paged2: 1,
				htype: 0,
				ways: 0,
				mdata: [],
				mdata2: [],
				settimer: null,
				cleartime: 0,
				tiaotype: 0,
				zhan: false,
				pagesCount: 0,
				scorechecked: true,
				score: 0,
				score_s: 0,
				skin: 'classics'
			}
		},
		onShareAppMessage(res) {
			let _this = this;
			return {
				title: _this.desc.title,
				path: '/pagesA/newpage/poordetail?id=' + _this.did,
				imageUrl: _this.desc.adimage,
			}
		},
		onLoad(e) {
			let _this = this
			this.id = e.id
			this.did = e.id;

			let pages = getCurrentPages();
			this.pagesCount = pages.length;
		},
		onShow() {
			if (uni.getStorageSync('skin')) {
				this.skin = uni.getStorageSync('skin')
			}

			let _this = this;
			setTimeout(() => {
				_this.loadtime = false
			}, 700)

			this.poordesc()
			this.poorLogList(1, 1)
			this.getuser()
			this.addressList()
			this.showbuy()

		},
		methods: {
			// 繁星赏页面
			gofan() {
				uni.navigateTo({
					url: '/pagesA/newpage/fandetail?id=' + this.did + '&num=' + this.desc.more_star_num
				})
			},
			// 展开 --- 收起
			zhanplay() {
				console.log(123123)
				this.zhan = !this.zhan
			},
			tiaoplay() {
				let _this = this
				this.cleartime = 1
				for (let i = _this.mdata.length; i >= 0; i--) {
					let index = Math.abs(i - _this.mdata.length)
					_this.mdata[index].type = 1
				}

			},
			async checkPoorLock() {
				let _this = this
				let item = await this.$api.post('luckorder/checkPoorLock', {
					good_poor_id: _this.did,
					token: uni.getStorageSync('token')
				})
				this.poorlock = item.data.result
				let nowtime = new Date().getTime() + ''
				let sss = (item.data.result.un_look_time * 1000 - nowtime) / 1000 + ''
				this.poorlock.un_look_time = sss.split('.')[0]
			},
			// 锁箱弹窗
			locktan() {
				uni.showToast({
					icon: 'none',
					title: '单人连续购买' + this.desc.locknum + '发且不被他人打断锁定套盒' + this.desc.locktm + '秒',
					duration: 2500
				});
			},
			showExplain(id, show) {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Index/explain',
					data: {
						id: id
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						_this.explain = res.data.data.desc;
						_this.modalName = 'Modal'
					}
				});
			},
			showbuy() {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Index/explain',
					data: {
						id: 19
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						_this.explain1 = res.data.data.desc.content;
					}
				});
			},
			jilupageright(e) {


				if (e == 1) {
					if (this.maxpaged2 == 0) {
						this.paged2++
						this.poorLogList(1, 2)
					} else {

					}
				} else {
					if (this.maxpaged == 0) {
						this.paged++
						this.poorLogList(1, 2)
					} else {

					}
				}
			},
			jilupageleft(e) {
				if (e == 1) {
					if (this.maxpaged2 == 1) {
						this.paged2 = this.paged2 - 2
						this.poorLogList(1, 1)
					} else {
						if (this.paged2 > 1) {
							this.paged2--
							this.poorLogList(1, 1)
						} else {
							uni.showToast({
								icon: 'none',
								title: '已经是第一页了',
							});
						}
					}
				} else {
					if (this.maxpaged == 1) {
						this.paged = this.paged - 2
						this.poorLogList(1, 1)
					} else {
						if (this.paged > 1) {
							this.paged--
							this.poorLogList(1, 1)
						} else {
							uni.showToast({
								icon: 'none',
								title: '已经是第一页了',
							});
						}
					}
				}

			},
			gobape() {
				uni.switchTab({
					url: '/pages/goodspoor/backpack'
				})
			},
			lookhiddenmes() {
				let _this = this;
				uni.navigateTo({
					url: `/pages/goodspoor/hiddendetail?id=` + _this.did
				});
			},
			viewAdimage() {
				this.lookprice = 0
				let adimage = [];
				adimage = adimage.concat(this.desc.adimage);
				this.photoimg = adimage
				this.modalName = 'photomodel';
				this.looktitle = this.desc.name

				// uni.previewImage({
				// 	urls: adimage,
				// 	current: 0
				// });
			},
			lookImages(url, title, price) {
				console.log(price)
				this.photoimg = url
				this.looktitle = title
				if (parseFloat(price) > this.desc.cost) {
					this.lookprice = price
				} else {
					this.lookprice = this.desc.cost
				}
				this.modalName = 'photomodel';
			},
			lookboxmes() {
				let _this = this;
				uni.navigateTo({
					url: `/pages/goodspoor/boxdetail?id=` + _this.did + `&num=` + _this.desc.box_limit_num +
						`&open_custom_box=` + _this.desc.open_custom_box2 + `&open_custom_box_mes=` + _this
						.open_custom_box_mes2 + `&num2=` + _this.desc.box_limit_num2 +
						`&open_custom_box2=` + _this.desc.open_custom_box + `&open_custom_box_mes2=` + _this
						.open_custom_box_mes1
				});
			},
			lookofmes() {
				let _this = this;
				uni.navigateTo({
					url: `/pages/goodspoor/ofdetail?id=` + _this.did + `&num=` + _this.desc.box_limit_num +
						`&open_custom_box=` + _this.desc.open_custom_box2 + `&open_custom_box_mes=` + _this
						.open_custom_box_mes2 + `&num2=` + _this.desc.box_limit_num2 +
						`&open_custom_box2=` + _this.desc.open_custom_box + `&open_custom_box_mes2=` + _this
						.open_custom_box_mes1
				});
			},
			onGetPhoneNumber(e) {
				let _this = this;
				wx.login({
					success(res) {
						uni.request({
							url: _this.$globals.apibase + '/api/Minlogin/getPhoneNumber',
							data: {
								token: uni.getStorageSync('token'),
								code: res.code,
								encryptedData: e.detail.encryptedData,
								iv: e.detail.iv,
								ver: _this.$mpVer
							},
							method: 'POST',
							header: {
								'content-type': 'application/json'
							},
							success: (res) => {
								if (res.data.code == '1') {
									_this.getuser()
									uni.showToast({
										icon: 'none',
										title: '授权成功!',
										duration: 1500,
									});

									setTimeout(() => {
										_this.buybutton(_this.timesd)
									}, 1500)

								} else {
									uni.showToast({
										icon: 'none',
										title: '授权失败!',
										duration: 3000,
									});
								}
								_this.modalName = null
							}
						});
					}
				})
			},
			addressList() {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Luckorder/addressList',
					data: {
						token: uni.getStorageSync('token'),
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
							_this.$uniApi.trylogin();
						}
						if (res.data.code == '1') {
							// _this.count = res.data.data.count;
							_this.addlength = res.data.data.list.length;
						}
					}
				});
			},
			showbuy_off() {
				this.modalName2 = null
				this.poorLogList(1, 1)
			},
			loadDesc(id) {
				let _this = this;
				_this.page = 1;
				_this.hasData = true;
				_this.loadModal = true;
				uni.request({
					url: _this.$globals.apibase + '/api/star/poorDesc',
					data: {
						token: uni.getStorageSync('token'),
						poor_id: _this.did,
						page: _this.page,
						index: uni.getStorageSync(id + 'len') || 0,
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
							_this.login();
						}
						if (res.data.code == '1') {
							if (_this.desc != null) {
								_this.desc.info_text = [];
							}
							_this.desc = res.data.data.desc;
							_this.title = _this.desc.name;
						}
						if (res.data.code == '0') {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}

						setTimeout(() => {
							_this.loadModal = false;
						}, 300)
					}
				});
			},
			submitLuck() {
				let _this = this;
				if (_this.racheck == false) {
					uni.$u.toast('请阅读并同意购买规则和服务协议');
					return;
				}

				_this.modalName = null;
				// if (_this.desc.othertype != '0') {
				// 	if (_this.times != 0) {
				// 		uni.showToast({
				// 			icon: 'error',
				// 			title: '该奖池为单抽奖池',
				// 			duration: 5000
				// 		});
				// 		return;
				// 	}
				// }
				if (_this.openbuy == true) {
					return;
				}


				_this.openbuy = true;
				_this.loadLuck = true;
				if (_this.desc.type == 2) {
					_this.buyradio = 0
				}
				// const date = (new Date().getTime() / 1000).toFixed(0);
				// var str = date + 'akd!k123#dfg' + _this.desc.id

				// 加密
				let str = _this.$uniApi.mdnum();
				var md5Str = md5.hex_md5(str[1])

				uni.request({
					url: _this.$globals.apibase + '/api/star/createOrder',
					data: {
						token: uni.getStorageSync('token'),
						poor_id: _this.did,
						times: _this.times,
						ver: _this.$mpVer,
						use_coupon: _this.buyradio,
						nonce: str[2],
						sign: md5Str,
						timestamp: str[0],
						// user_score: _this.scorechecked ? 1 : 0
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						_this.loadLuck = false;
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
						}
						if (res.data.code == '1') {
							if (res.data.data.state == 1) {
								/*uni.showToast({
									icon: 'success',
									title: '抽取成功',
									duration: 5000,
								});*/
								uni.request({
									url: _this.$globals.apibase + '/api/User/doRank',
									data: {
										token: uni.getStorageSync('token'),
										price: _this.buycount * _this.desc.cost,
									},
									method: 'POST',
									header: {
										'content-type': 'application/json'
									},
									success: (res) => {},
								});
								_this.getuser();
								_this.loadDesc(_this.desc.id);
								_this.modalName = null;
								_this.modalName2 = 'buyModal';
								_this.openbuy = false;
								_this.getspecial = res.data.data.getspecial
								//带着抽取记录去奖励界面
								_this.mdata = res.data.data.zGoodsList

								_this.cleartime = 0
								let num = _this.mdata.length - 1
								_this.settimer = setInterval(function() {
									if (_this.cleartime == 1 || num < 1) {
										clearInterval(_this.settimer)
										console.log('停止计时器')
										this.settimer = null;
									}
									console.log(num)
									_this.mdata[num].type = 1
									num--
								}, 1000)

								// for (let i = _this.mdata.length; i >= 0; i--) {
								// 	console.log(_this.cleartime)
								// 	if (_this.cleartime == 1) {
								// 		return
								// 	} else {
								// 		_this.settimer = setTimeout(function() {
								// 			if (_this.cleartime == 1) {
								// 				clearInterval(_this.settimer)
								// 				console.log('停止计时器')
								// 				this.settimer = null;
								// 			}
								// 			let index = Math.abs(i - _this.mdata.length)
								// 			_this.mdata[index].type = 1
								// 		}, i * 1000)
								// 	}
								// }
							} else if (res.data.data.state == 0) {
								uni.requestPayment({
									timeStamp: res.data.data.result.timeStamp,
									nonceStr: res.data.data.result.nonceStr,
									package: res.data.data.result.package,
									signType: res.data.data.result.signType,
									paySign: res.data.data.result.paySign,
									success: function(result) {
										/*uni.showToast({
											icon: 'success',
											title: '支付成功',
											duration: 5000,
										});*/
										_this.getuser();
										_this.modalName = null;

										_this.openbuy = false;
										_this.loadModal = true;
										// _this.getspecial = res.data.data.getspecial
										// _this.modalName2 = 'buyModal';
										// let ssss = res.data.data.log_reword
										// let dddd = res.data.data.special_rewords
										// _this.buylist = JSON.parse(ssss)
										// _this.buylist2 = JSON.parse(dddd)
										let str = _this.$uniApi.mdnum();
										var md5Str = md5.hex_md5(str[1])

										uni.request({
											url: _this.$globals.apibase +
												'/api/star/createOrder',
											data: {
												token: uni.getStorageSync('token'),
												good_poor_id: _this.did,
												times: _this.times,
												ver: _this.$mpVer,
												use_coupon: _this.buyradio,
												good_type: 'goods',
												nonce: str[2],
												sign: md5Str,
												timestamp: str[0],
												single: _this.tabhs,
												// user_score: _this.scorechecked ? 1 : 0
											},
											method: 'POST',
											header: {
												'content-type': 'application/json'
											},
											success: (res) => {
												_this.loadLuck = false;
												if (res.data.code == '401') {
													uni.setStorageSync('token', '');
													_this.$uniApi.trylogin();
												}
												if (res.data.code == '1') {
													if (res.data.data.state == 1) {
														/*uni.showToast({
															icon: 'success',
															title: '抽取成功',
														});*/
														uni.request({
															url: _this.$globals
																.apibase +
																'/api/User/doRank',
															data: {
																token: uni
																	.getStorageSync(
																		'token'
																	),
																price: _this
																	.buycount *
																	_this.desc
																	.cost,
															},
															method: 'POST',
															header: {
																'content-type': 'application/json'
															},
															success: (
																res) => {},
														});
														uni.request({
															url: _this.$globals
																.apibase +
																'/api/User/doRank',
															data: {
																token: uni
																	.getStorageSync(
																		'token'
																	),
																price: _this
																	.buycount *
																	_this.desc
																	.cost,
															},
															method: 'POST',
															header: {
																'content-type': 'application/json'
															},
															success: (
																res) => {},
														});
														_this.getuser();
														_this.loadDesc(_this.desc.id);
														_this.modalName = null;
														_this.modalName2 = 'buyModal';
														_this.openbuy = false;
														_this.getspecial = res.data
															.data.getspecial
														//带着抽取记录去奖励界面
														_this.mdata = res.data.data
															.zGoodsList

														_this.cleartime = 0
														let num = _this.mdata.length -
															1
														_this.settimer = setInterval(
															function() {
																if (_this
																	.cleartime ==
																	1 || num < 1) {
																	clearInterval(
																		_this
																		.settimer
																	)
																	console.log(
																		'停止计时器'
																	)
																	this.settimer =
																		null;
																}
																console.log(num)
																_this.mdata[num]
																	.type = 1
																num--
															}, 1000)
													}
												} else {
													if (res.data.msg == '') {
														res.data.msg = '服务器繁忙,购买失败';
													}
													uni.showToast({
														icon: 'none',
														title: res.data.msg
													});
													_this.openbuy = false;
												}
												this.poorLogList(1, this.sssnum)
												this.poorLogList(2, this.ssrnum)
												this.poorLogList(3, this.boxnum)
											},
										});

									},
									fail: (res) => {
										_this.openbuy = false;
									},
									cancel: (res) => {
										_this.openbuy = false;
									},
								})
							} else {
								if (res.data.msg == '') {
									res.data.msg = '服务器繁忙,购买失败';
								}
								uni.showToast({
									icon: 'none',
									title: res.data.msg
								});
								_this.openbuy = false;
							}
						}
						if (res.data.code == '0') {
							if (res.data.msg == '') {
								res.data.msg = '服务器繁忙,购买失败';
							}
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
							_this.openbuy = false;
							_this.loadDesc(_this.did);
						}
					},
					fail: (res) => {
						_this.openbuy = false;
					},
					cancel: (res) => {
						_this.openbuy = false;
					},
				});
			},
			waysChanged(e) {
				this.ways = e.detail.value;
				console.log(e)
			},
			isSave() {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Luckorder/isSave',
					data: {
						token: uni.getStorageSync('token'),
						id: this.id
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.data.count == 0) {
							_this.liked = 0;
						} else {
							_this.liked = 1;
						}
					}
				});
			},
			// 获取个人信息
			getuser() {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Userways/userFront',
					data: {
						token: uni.getStorageSync('token'),
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '1') {
							_this.descm = res.data.data.user_desc
							_this.id = res.data.data.user_desc.id;
							_this.money = res.data.data.user_desc.money;
							// _this.score = Number(res.data.data.user_desc.score)
							_this.score = 0
							_this.pray_number = res.data.data.user_desc.pray_number;
							_this.coupon = res.data.data.user_desc.coupon / 10;
						}
					}
				});
			},
			hideModal(e) {
				this.modalName = null
				this.buyradio = 1
				this.checked = true
				this.scorechecked = true
				this.poorLogList(1, 1)
			},
			hideModal2(e) {
				this.modalNamebuy = null
				this.modalName2 = false
				this.poorLogList(1, 1)
				this.cleartime = 1

				clearTimeout(this.settimer);
				this.settimer = null;
			},
			// 积分可抵值按钮
			scoreChange() {
				let _this = this,
					scorenum = Number(_this.score / 10 > _this.buymoney / 2 ? _this.buymoney / 2 : _this.score / 10)
				this.scorechecked = !this.scorechecked
				if (this.scorechecked) {
					_this.buymoneys = Number(_this.buymoneys - scorenum > 0 ? _this.buymoneys - scorenum : 0).toFixed(2)
					// console.log(_this.buymoneys)
				} else {
					console.log(_this.buymoney)
					_this.buymoneys = (Number(_this.buymoneys) + scorenum).toFixed(2) > _this.buymoney ? _this.buymoneys :
						(Number(_this.buymoneys) + scorenum).toFixed(2)
				}
			},
			radioChange(e) {
				let _this = this,
					scorenum = Number(_this.score / 10 > _this.buymoney / 2 ? _this.buymoney / 2 : _this.score / 10)

				this.checked = !this.checked
				console.log(this.checked)
				console.log(this.buyradio)
				let sss = this.buymoney.split('欧')[0];
				this.buymoneys = sss - this.coupon
				if (this.buyradio == 1) {
					this.buyradio = 0
					this.buymoneys = this.buymoney
				} else {
					console.log(123123)
					let sss = this.buymoney.split('欧')[0];
					let a = sss - this.coupon
					if (a > 0) {
						this.buymoneys = a
					} else {
						this.buymoneys = 0
					}
					this.buyradio = 1
				}


				if (_this.scorechecked) {
					_this.buymoneys = Number(_this.buymoneys - scorenum > 0 ? _this.buymoneys - scorenum : 0).toFixed(2)
				} else {
					_this.buymoneys = (Number(_this.buymoneys) + scorenum).toFixed(2) > Number(_this.buymoney) ? _this
						.buymoneys :
						(Number(_this.buymoneys) + scorenum).toFixed(2)
				}
				console.log(_this.buymoneys)


			},
			buybutton(times) {
				let _this = this;

				// 判断有无绑定手机号
				if (this.descm.mobile == '') {
					this.$refs.uToast.show({
						message: "请先绑定手机号",
						duration: 1500,
					})
					setTimeout(() => {
						_this.modalName = 'getPhoneNumber';
					}, 1500)

					this.timesd = times
					return
				}

				// 判断有无收货地址
				if (this.addlength == 0) {
					this.$refs.uToast.show({
						message: "请添加收货地址",
						duration: 1500,
					})
					setTimeout(() => {
						uni.navigateTo({
							url: '/pages/index/address'
						})
					}, 1500)
					return
				}


				let now = parseInt(new Date().getTime()) + '';
				let wait = 1000;
				if (now - this.previous > wait) {
					this.previous = now;
					this.doLuck(times)
				} else {
					// uni.showToast({
					// 	icon: 'none',
					// 	title: '请勿频繁操作',
					// });
				}
			},
			doLuck(times) {
				console.log(22222)
				this.checked = true
				this.scorechecked = true
				this.buyradio = 1
				let _this = this;
				if (_this.loadLuck == true || _this.openbuy == true) {
					return;
				}
				_this.times = times;
				if (_this.times == 0) {
					_this.buycount = 1;
				}
				if (_this.times == 1) {
					_this.buycount = 3;
				}
				if (_this.times == 2) {
					_this.buycount = 10;
				}
				if (_this.desc.count < _this.buycount) {
					uni.showToast({
						icon: 'none',
						title: '奖池剩余抽数不足' + _this.buycount + '发',
						duration: 5000
					});
					return;
				}
				_this.buymoney = parseFloat(_this.buycount * _this.desc.cost).toFixed(2);
				let coupon = parseFloat(_this.coupon)
				if (coupon < _this.buymoney) {
					_this.coupon_s = _this.coupon
				} else {
					_this.coupon_s = _this.buymoney
				}
				let numss = parseFloat(_this.buycount * _this.desc.cost).toFixed(2) - _this.coupon
				if (numss > 0) {
					_this.buymoneys = numss;
				} else {
					_this.buymoneys = 0;
				}

				if (_this.scorechecked) {
					let scorenum = Number(_this.score / 10 > _this.buymoney / 2 ? _this.buymoney / 2 : _this.score / 10)
					_this.buymoneys = Number(_this.buymoneys - scorenum > 0 ? _this.buymoneys - scorenum : 0).toFixed(2)
				}

				// _this.buymoneys = parseFloat(_this.buycount * _this.desc.cost).toFixed(2);
				if (_this.desc.type == 2) {
					let mes = '';
					if (_this.score >= _this.buymoney) {} else {
						mes += '积分不足，无法购买';
					}
					_this.buymes = mes;
					_this.buymoney += '积分';
				} else {
					let mes = '';
					if (parseFloat(_this.money) >= parseFloat(_this.buymoney)) {} else {
						mes += '不足，';
						let needpay = parseFloat(_this.buymoney - _this.money).toFixed(2);
						mes += '需支付' + needpay + '';
					}
					_this.buymes = mes;
				}
				//_this.modalName = 'paymodel';
				_this.modalName = 'bottomModal';
			},
			// 刷新
			startR() {
				if (getApp().globalData.couldFresh == true) {
					getApp().globalData.couldFresh = false;
					setTimeout(() => {
						getApp().globalData.couldFresh = true;
					}, 1000)
				} else {
					/*uni.showToast({
						icon: 'none',
						title: '刷新频率点击太快啦'
					});*/
					return;
				}
				this.refreshtime += 1;
				this.openbuy = false;
				//this.getuser();
				this.loadDesc(this.did);
				this.poorLogList(1, 1)
			},
			// 有底池 -- 记录
			poorLogList(page, one) {
				let _this = this
				_this.loadModal = true;
				uni.request({
					url: _this.$globals.apibase + '/api/star/poorLogs',
					data: {
						token: uni.getStorageSync('token'),
						poor_id: _this.did,
						page1: _this.paged,
						page2: _this.paged2,
						count1: 1
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
						}
						if (res.data.code == '1') {
							if (res.data.data.list1 == '' && one == 2) {
								_this.maxpaged = 1
								uni.showToast({
									icon: 'none',
									title: '已经是最后一页了',
								});
							} else {
								_this.maxpaged = 0
								_this.xinglist1 = res.data.data.list1
							}

							if (res.data.data.list2 == '' && one == 2) {
								_this.maxpaged2 = 1
								uni.showToast({
									icon: 'none',
									title: '已经是最后一页了',
								});
							} else {
								_this.maxpaged2 = 0
								_this.xinglist2 = res.data.data.list2
							}
						}
						if (res.data.code == '0') {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
						setTimeout(() => {
							_this.loadModal = false;
						}, 300)
					}
				});
			},
			savePoor(id) {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Luckorder/savePoor',
					data: {
						token: uni.getStorageSync('token'),
						goods_poor_id: id,
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
						}
						if (res.data.code == '1') {
							uni.showToast({
								icon: 'success',
								title: '添加收藏成功'
							});
							_this.liked = 1;
						}
						if (res.data.code == '0') {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
					}
				});
			},
			unsavePoor(id) {
				let _this = this;
				uni.request({
					data: {
						token: uni.getStorageSync('token'),
						goods_poor_id: id,
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
						}
						if (res.data.code == '1') {
							uni.showToast({
								icon: 'success',
								title: '取消收藏成功'
							});
							_this.liked = 0;
						}
						if (res.data.code == '0') {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
					}
				});
			},
			gotop() {
				uni.navigateTo({
					url: '/pages/goodspoor/index'
				})
			},
			back() {
				if (this.pagesCount == 1) {
					uni.switchTab({
						url: '/pages/goodspoor/index'
					})
				} else {
					uni.navigateBack()
				}
			},
			// tab切换
			tab_btn(e) {
				this.tab = e
			},
			// 获取奖池
			async poordesc() {
				let _this = this
				let item = await this.$api.post('star/poorDesc', {
					token: uni.getStorageSync('token'),
					poor_id: _this.did,
					orderid: 1,
					keyword: '',
					page: 1
				})
				this.desc = item.data.desc
				return
				let Anum = 0,
					QJnum = 0
				item.data.desc.info_text.forEach(function(it) {
					if (it.reword_type_id == 3) {
						QJnum += it.allnumber
					}
					if (it.reword_type_id == 4) {
						Anum += it.allnumber
					}
				})
				this.numqj = QJnum
				this.numa = Anum
			},
		},
	}
</script>

<style lang="less" scoped>
	.qingcolor {
		color: #fff;
	}

	.orcolor {
		color: #59100B;
	}

	.opend {
		height: calc(var(--height) * 128rpx);
	}

	.pos_bgc2 {
		position: absolute;
		top: 10%;
		left: 0;
		z-index: 18;
	}

	.pos_bgc {
		position: absolute;
		top: 10%;
		left: 0;
		-webkit-transform: rotate(360deg);
		animation: rotation 60s linear infinite;
		-moz-animation: rotation 12s linear infinite;
		-webkit-animation: rotation 12s linear infinite;
		-o-animation: rotation 12s linear infinite;
		z-index: 15;
	}

	@-webkit-keyframes rotation {
		from {
			-webkit-transform: rotate(0deg);
		}

		to {
			-webkit-transform: rotate(360deg);
		}
	}

	.tiaoguo {
		width: 18%;
		position: absolute;
		top: -5%;
		left: 41%;
		z-index: 99999;
		font-size: 26rpx;
		border-radius: 50rpx;
		font-weight: bold;
		height: 60rpx;
		line-height: 58rpx;
		color: #000;
		background-color: rgba(255, 255, 255, .8);
	}

	.fanoff {
		opacity: 0;
	}


	.opc {
		opacity: 1;
	}

	.fanon {
		transform: rotateY(180deg);
		opacity: 1;
	}

	.losed {
		background-color: rgba(0, 0, 0, .7);
		position: absolute;
		left: 0;
		top: 0;
		z-index: 2;
		font-size: 100rpx;
	}

	.jiangitem {
		float: left;
		margin-right: 20rpx;
		margin-bottom: 30rpx;
		transition: .5s;
		background-color: rgba(255, 255, 255, .9);
		position: relative;
		margin-left: 5rpx;

		.baotext {
			position: absolute;
			top: 5rpx;
			right: 5rpx;
			color: red;
		}
	}

	.jiangitem:nth-child(5n) {
		margin-right: 0;
	}

	.bottom_item {
		width: 98%;
		padding-left: 2%;
		margin-top: 35rpx;
		position: relative;
		// box-shadow: 0rpx 0rpx 15rpx 0rpx #4e4e4e;
		border-radius: 20rpx;

		.bgcimg {
			width: 99%;
			position: absolute;
			top: -30rpx;
			left: 1%;
			z-index: 20;
		}

		.bgcimgwinter {
			width: 60%;
			position: absolute;
			top: -5rpx;
			right: -1%;
			z-index: 20;
		}

		.bgcimg1 {
			width: 100%;
			position: absolute;
			top: -70rpx;
			right: -1%;
			z-index: 20;
		}

		.xingbgc {
			width: 90%;
			position: absolute;
			top: 18rpx;
			left: 5%;
			z-index: 20;
		}

		.bgc_bot {
			border-radius: 20rpx;
			// background-color: #F0E3CE;
		}

		.skinbgc {
			background-color: #F0E3CE;
			box-shadow: 0rpx 0rpx 15rpx 0rpx #4e4e4e;
			border-radius: 20rpx;
		}
	}


	.top_item {
		margin: 60rpx auto 0;
		position: relative;

		.fan_item {
			position: absolute;
			top: 60%;
			left: -15%;
			z-index: 999;
		}

		.imgto {
			margin-top: -20rpx;
		}

		.heng {
			background-color: #F5F5F5;
			width: 565rpx;
			height: 32rpx;
			border-radius: 10rpx;
			overflow: hidden;
			border: 4rpx solid #fff;
			position: relative;

			.numd {
				position: absolute;
				right: 15rpx;
				top: 0rpx;
				z-index: 99;
				color: #000;
				font-weight: bold;
				font-size: 19rpx;
				width: 100%;
				text-align: center;
				line-height: 24rpx;
			}

			.its {
				background-color: #ECBD37;
				border-radius: 10rpx;
			}

		}
	}

	.loadshow {
		transition: .3s;
		opacity: 1;
	}

	.loadnoshow {
		transition: .3s;
		opacity: 0;
	}

	page {
		background-color: #B7E0DA;
	}

	.left_scr {
		background-color: rgba(0, 0, 0, .3);
	}

	.text_color1 {
		color: #922D2D;
	}

	.text_color2 {
		color: #E60000;
	}

	.text_color3 {
		color: #5C5C92;
	}

	.cu-dialog {
		// background-image: linear-gradient(#8acee7, #ADE3E4);
	}

	.text_item {
		// height: 30rpx;
		// line-height: 30rpx;
		// color: #fff;
	}


	.record {
		background-color: rgba(92, 92, 146, .4);
		min-height: 100rpx;
		width: 95%;
		margin: 30rpx auto 0;
	}

	.skinca {
		// background-color: #ECC7A0;
		background-color: rgba(236, 199, 160, .8);
	}

	.skinwin {
		background-color: rgba(92, 92, 146, .4);
	}

	.list_item {
		float: left;
		margin-bottom: 20rpx;
		margin-right: 25rpx;
	}

	.list_item:nth-child(4n) {
		margin-right: 0;
	}

	.refresh {
		position: fixed;
		right: 40rpx;
		bottom: 350rpx;
		z-index: 99;
	}

	.btns {
		position: fixed;
		bottom: 10rpx;
		z-index: 999;
	}

	.jitem {
		display: inline-block;
		margin-right: 60rpx;
	}


	.zinde {
		position: relative;
		z-index: 10;
	}

	.card_bgc {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 0;
	}

	.auto {
		margin: 0 auto;
	}

	button:after {
		border: none;
	}

	.score {
		position: absolute;
		top: 0;
		right: 0;
		background-color: #057DD6;
		color: #fff;
		padding: 5rpx 10rpx;
	}

	.buylock {
		position: absolute;
		top: 0;
		left: 0;
		background-color: red;
		color: #fff;
		padding: 5rpx 10rpx;
	}

	.userlock {
		position: absolute;
		bottom: 0;
		background-color: red;
		color: #fff;
		padding: 5rpx 10rpx;
	}

	.animation {
		width: 115%;
		height: 120%;
		position: absolute;
		left: -8%;
		top: -8%;
		z-index: 9999;
		background-size: 100% 100%;
		background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/1.png');
		animation-name: likes; // 动画名称
		animation-direction: 10; // 动画在奇数次（1、3、5...）正向播放，在偶数次（2、4、6...）反向播放。
		animation-timing-function: linear; // 动画执行方式，linear：匀速；ease：先慢再快后慢；ease-in：由慢速开始；ease-out：由慢速结束；ease-in-out：由慢速开始和结束；
		animation-delay: 0s; // 动画延迟时间
		animation-iteration-count: infinite; //  动画播放次数，infinite：一直播放
		animation-duration: 4s; // 动画完成时间
		animation-fill-mode: backwards;
		display: block;
	}

	@keyframes likes {
		0% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/1.png');
		}

		// 2% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/2.png');
		// }

		4% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/3.png');
		}

		// 6% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/4.png');
		// }

		8% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/5.png');
		}

		10% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/6.png');
		}

		// 12% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/7.png');
		// }

		14% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/8.png');
		}

		// 16% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/9.png');
		// }

		18% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/10.png');
		}

		20% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/11.png');
		}

		// 22% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/12.png');
		// }

		24% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/13.png');
		}

		// 26% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/14.png');
		// }

		28% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/15.png');
		}

		30% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/16.png');
		}

		// 32% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/17.png');
		// }

		34% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/18.png');
		}

		// 36% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/19.png');
		// }

		38% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/20.png');
		}

		40% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/21.png');
		}

		// 42% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/22.png');
		// }

		44% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/23.png');
		}

		// 46% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/24.png');
		// }

		48% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/25.png');
		}

		50% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/26.png');
		}

		// 52% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/27.png');
		// }

		54% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/28.png');
		}

		// 56% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/29.png');
		// }

		58% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/30.png');
		}

		60% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/31.png');
		}

		// 62% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/32.png');
		// }

		64% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/33.png');
		}

		// 66% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/34.png');
		// }

		68% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/35.png');
		}

		70% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/36.png');
		}

		// 72% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/37.png');
		// }

		74% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/38.png');
		}

		// 76% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/39.png');
		// }

		78% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/40.png');
		}

		80% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/41.png');
		}

		// 82% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/42.png');
		// }

		84% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/43.png');
		}

		// 86% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/44.png');
		// }

		88% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/45.png');
		}

		90% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/1.png');
		}

		// 92% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/1.png');
		// }

		94% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/1.png');
		}

		// 96% {
		// 	background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/1.png');
		// }

		98% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/1.png');
		}

		100% {
			background-image: url('https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/animation/2.png');
		}
	}
</style>